package thread;

public class demo39 {
    private static int sum = 0;
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            int result = 0;
            for (int i = 1; i <= 100; i++) {
                result += i;
            }
            //runnable是没有返回值的，不能return
            //return result
            sum = result;
        });

        t.start();
        t.join();
        System.out.println(sum);
        
    }
}
